package com.cci.zkweb.core.services.impl;

import java.io.Serializable;

import com.cci.zkweb.core.entity.User;
import com.cci.zkweb.core.services.UserInfoService;
import com.cci.zkweb.core.util.LdapUtils;

public class UserInfoServiceImpl 
implements UserInfoService, Serializable {
	private static final long serialVersionUID = 1L;

	/** synchronized is just because we use static userList in this demo to prevent concurrent access **/
	public synchronized User findUser(String account) {
		return null;
	}

	/** synchronized is just because we use static userList in this demo to prevent concurrent access **/
	public synchronized User updateUser(User user) {
		throw new RuntimeException("utente non trovato " + user.getAccount());
	}
	
	/** check user credential **/
	public synchronized User checkUserCredential(String account, String password) {
		return LdapUtils.authenticate(account, password);
	}
}
